/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yunhoo.base.db.impl;

import com.ibatis.dao.client.DaoManager;
import com.ibatis.dao.client.template.SqlMapDaoTemplate;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.yunhoo.base.db.dao.AssetGBCodeDao;
import com.yunhoo.base.model.AssetGBCode;
import com.yunhoo.sys.db.util.DbTool;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Administrator
 */
public class AssetGBCodeDaoImpl extends SqlMapDaoTemplate implements AssetGBCodeDao {

    private static SqlMapClient sqlmap;
    private String nameSpace = "assetGBCode.";

    public AssetGBCodeDaoImpl(DaoManager daoManager) {
        super(daoManager);
        sqlmap = DbTool.getSqlMapClient();
    }

    @Override
    public List<AssetGBCode> queryAll() throws SQLException {
        return sqlmap.queryForList(nameSpace + "queryAll", new AssetGBCode());
    }

    @Override
    public List<AssetGBCode> queryList() throws SQLException {
        return sqlmap.queryForList(nameSpace + "queryList", new AssetGBCode());
    }
    
    

    @Override
    public List<AssetGBCode> queryList(AssetGBCode param){
        try {
            return sqlmap.queryForList(nameSpace + "queryList", param);
        } catch (SQLException ex) {
            Logger.getLogger(AssetGBCodeDaoImpl.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }
}
